package com.xy.tool.gid.controller;

import com.xy.lang.domain.Result;
import com.xy.tool.gid.service.GidService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "编号服务")
@RestController
@RequestMapping("/api/gid")
public class GidController {

    @Autowired
    private GidService gidService;

    @ApiOperation("生成ID")
    @PostMapping(value = "/generate")
    public Result<Long> generate() {
        return Result.success(gidService.generate());
    }

}
